<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>class静态成员</title>
</head>
<body>

</body>

<script>
    //ES5
    function Phone (){

    }
    Phone.name = '苹果';
    Phone.size = 19;

    let phone = new Phone();
    console.log(phone.name) //无法获取，作为方法的属性，而非对象的属性。

    //ES6
    class Shouji{
        static name = '华为';
        static call (){
            console.log('打电话');
        }
    }
    let shouji = new Shouji();
    console.log(shouji.name);//同上

</script>


</html>